/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cluster

import (
	"github.com/rs/zerolog/log"
	"github.com/spf13/cobra"
	"satellite/app/cluster"
)

// deleteCmd represents the restartCmd command
var deleteCmd = &cobra.Command{
	Use:     "delete",
	Aliases: []string{"remove", "rm"},
	Short:   "删除集群",
	Long:    ``,
	Args:    Args,
	Run: func(cmd *cobra.Command, args []string) {
		runner := cluster.NewDelete(deleteOption).WithBase(base)
		err := runner.Run()
		if err != nil {
			log.Warn().Err(err).Send()
			return
		}
	},
}

var (
	deleteOption = new(cluster.DeleteOption)
)

func init() {
	clusterCmd.AddCommand(deleteCmd)
	deleteCmd.Flags().BoolVarP(&deleteOption.KeepPvc, "keep-pvc", "", false, "保留实例PVC")
}
